package com.wangijun.yuan.core.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wangijun.yuan.core.base.YesNoEnum;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 博客简介表
 */
@Schema(description = "博客简介表")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "article")
public class Article implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    /**
     * 摘要
     */
    @TableField(value = "summary")
    @Schema(description = "摘要")
    private String summary;

    /**
     * 标题
     */
    @TableField(value = "title")
    @Schema(description = "标题")
    private String title;

    /**
     * 阅读数
     */
    @TableField(value = "read_num")
    @Schema(description = "阅读数")
    private Integer readNum;

    /**
     * 博客封面
     */
    @TableField(value = "article_cover")
    @Schema(description = "博客封面")
    private String articleCover;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 创建人
     */
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    @Schema(description = "创建人")
    private Long createBy;

    /**
     * 更新人
     */
    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新人")
    private Long updateBy;

    /**
     * 逻辑删除标识 1已删除;0未删除
     */
    @TableField(value = "deleted")
    @Schema(description = "逻辑删除标识 1已删除;0未删除")
    private YesNoEnum deleted;

    /**
     * 发布状态 1已发布;0未发布
     */
    @TableField(value = "`status`")
    @Schema(description = "发布状态 1已发布;0未发布")
    private YesNoEnum status;

    /**
     * 点赞数
     */
    @TableField(value = "star")
    @Schema(description = "点赞数")
    private Integer star;

    /**
     * 收藏数量
     */
    @TableField(value = "favorites")
    @Schema(description = "收藏数量")
    private Integer favorites;

    /**
     * 分类ID
     */
    @TableField(value = "category_id")
    @Schema(description = "分类ID")
    private Long categoryId;

    /**
     * 评论数量
     */
    @TableField(value = "comment_num")
    @Schema(description = "评论数量")
    private Integer commentNum;

    /**
     * 话题ID
     */
    @TableField(value = "topic_id")
    @Schema(description = "话题ID")
    private Long topicId;

    /**
     * 最后编辑时间
     */
    @TableField(value = "edit_time")
    @Schema(description = "最后编辑时间")
    private LocalDateTime editTime;
    @Serial
    private static final long serialVersionUID = 1L;
}